package com.mf.service.basic;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mf.entity.dto.basic.DtoUser;
import com.mf.entity.dto.basic.DtoUserRole;

import com.mf.entity.req.basic.ReqUserRole;
import com.mf.entity.req.basic.reqPublic.ReqPublicPaging;
import com.mf.entity.req.basic.search.SearchReqUserRole;
import com.mf.service.BaseService;

import java.util.Set;


/**
 * 权限角色关联关系
 */
public interface ServiceUserRole extends BaseService<DtoUserRole, SearchReqUserRole> {
    /**
     * 根据角色id查询绑定数量
     */
    long countByRoleId(Integer roleId);


    /**
     * 根据角色id查询已关联用户
     */
    Page<DtoUser> pageUserByRole(Integer roleId, ReqPublicPaging reqPublicPaging);


    Set<Integer> listUserByRole(Integer roleId);

    /**
     * 根据角色id查询未关联用户
     */
    Page<DtoUser> pageUserByNoRole(Integer roleId, ReqPublicPaging reqPublicPaging);

    /**
     * 根据用户ids关联角色
     */
    void addByAppend(ReqUserRole reqUserRole);

    /**
     * 根据角色id删除关联用户
     */
    void deleteByRoleId(ReqUserRole reqUserRole);


}

